//
// Pagination (multiple pages)
// --------------------------------------------------

//== Pagination variable
// -------------------------
$pagination-color: $link-color !default;
$pagination-bg: $color-white !default;
$pagination-border-color: #dddddd !default;

$pagination-hover-color: $link-hover-color !default;
$pagination-hover-bg: $color-gray-lighter !default;
$pagination-hover-border-color: #dddddd !default;

$pagination-active-color: $color-white !default;
$pagination-active-bg: $brand-primary !default;
$pagination-active-border-color: $brand-primary !default;

$pagination-disabled-color: $color-gray-light !default;
$pagination-disabled-bg: $color-white !default;
$pagination-disabled-border-color: #dddddd !default;

@mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
    > li {
        > a, 
        > span {
            padding: $padding-vertical $padding-horizontal;
            line-height: $line-height;
            font-size: $font-size;
        }
        &:first-child {
            > a, 
            > span {
                @include fn-border-left-radius($border-radius);
            }
        }
        &:last-child {
            > a, 
            > span {
                @include fn-border-right-radius($border-radius);
            }
        }
    }
}

//== Pagination styles
// -------------------------
.pagination {
    display: inline-block;
    margin: $line-height-computed 0;
    padding-right: 0;
    padding-left: 0;
    @include fn-border-radius($border-radius-base);

    > li {
        display: inline; // Remove list-style and block-level defaults
        
        > a, 
        > span {
            position: relative;
            float: left;
            margin-left: -1px;
            padding: $padding-base-vertical $padding-base-horizontal;
            line-height: $line-height-base;
            background-color: $pagination-bg;
			border: 1px solid $pagination-border-color;
            color: $pagination-color;
            text-decoration: none;
        }
        &:first-child {
            > a, 
            > span {
                margin-left: 0;
                @include fn-border-left-radius($border-radius-base);
            }
        }
        &:last-child {
            > a, 
            > span {
                @include fn-border-right-radius($border-radius-base);
            }
        }
    }

    > li > a, 
    > li > span {
        &:hover,
        &:focus {
            z-index: 2;
            background-color: $pagination-hover-bg;
            border-color: $pagination-hover-border-color;
            color: $pagination-hover-color;
        }
    }

    > .active > a, 
    > .active > span {
        &, 
        &:hover, 
        &:focus {
            z-index: 3;
            background-color: $pagination-active-bg;
            border-color: $pagination-active-border-color;
            color: $pagination-active-color;
            cursor: default;
        }
    }

    > .disabled {
        > span, 
        > span:hover, 
        > span:focus, 
        > a, 
        > a:hover, 
        > a:focus {
            background-color: $pagination-disabled-bg;
            border-color: $pagination-disabled-border-color;
            color: $pagination-disabled-color;
            cursor: $cursor-disabled;
        }
    }
}

// Sizing
// -------------------------
// Large
.pagination-lg {
    @include pagination-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $border-radius-large);
}

// Small
.pagination-sm {
    @include pagination-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $border-radius-small);
}